/*
 * TCPSocket.h
 *
 *  Created on: Mar 14, 2013
 *      Author: Xi
 */
#include <string>
#include "Utilities.h"
#include"DBAccess.h"
#ifndef TCPSOCKET_H_
#define TCPSOCKET_H_

using namespace std;

class TCPSocket {
public:
    TCPSocket();
    virtual ~TCPSocket();

    Utilities utl;

    bool setUp(int port);
    bool listenConnection();
    int conn(int port, char* hostname);
    string recvMsg(int sockfd);
    void sendMsg(string msg, int sockfd);
    void recvMsg1(int sockfd, char c[]);
    string parseClientCmd(string cmd, int csock);

};

#endif /* TCPSOCKET_H_ */
